<div id="content">
	<div id="top">
		<h3>Couriers</h3>
		<%= render :partial => '/partials/help_link', :locals => {:path => {:controller => "help", :action => "couriers", :anchor => "index"}} %>
	</div>
	<div id="filter">
		<div class="left">
			<p>Showing <%= Courier.all.size %> Couriers</p>
		</div>
		<!-- UNIMPLEMENTED
		<div class="right">
			<input type="text" value="type name and enter" />
			<select>
				<option>Sort by...</option>
				<option>First Name</option>
				<option>Last Name</option>
			</select>
			<select>
				<option>Show...</option>
				<option>Active</option>
				<option>Inactive</option>
			</select>
		</div>
		-->
	</div>
	<div id="courier-list">
		<table class="header">
			<tr>
				<th class="first">Courier</p>
				<th class="second">Status</p>
				<th class="last">Routes</p>
			</tr>
            <% Courier.all.each do |courier| %>
                <tr>
                    <td class="first">
                        <%= courier.user.real_name %>
                    </td>
                    <td class="second">
                        <%= courier.active ? "Active" : "Inactive" %>
                    </td>
                    <td class="last">
                        <% courier.route_recurrence_rules.map {|x| x.route}.each do |route| %>
							<%= link_to route.name, edit_route_path(route) %>
						<% end %>
                    </td>
                </tr>
            <%end%>
		</table>
	</div>
</div>